package com.bawei.shopping2.repository

import com.bawei.shopping2.entity.BannerEntity
import com.bawei.shopping2.entity.CategoryEntity
import com.bawei.shopping2.entity.GoodsEntity
import com.bawei.shopping2.http.ApiResponse
import com.bawei.shopping2.http.ApiService
import com.bawei.shopping2.http.RetrofitManager
import retrofit2.http.Query
import javax.inject.Inject
//仓库
class MainRepository @Inject constructor(private var apiService: ApiService){
    //轮播图
    suspend fun banners():ApiResponse<MutableList<BannerEntity>>{
       return apiService.banners()
    }

    //一级分类
    suspend fun mainCategory():ApiResponse<MutableList<CategoryEntity>>{
        return apiService.mainCategory()
    }
    //二级分类
    suspend fun category( parent_id:Int):ApiResponse<MutableList<CategoryEntity>>{
        return apiService.category(parent_id)
    }
    //商品信息
    suspend fun goods(category_id:Int, currentPage:Int, pageSize:Int):ApiResponse<MutableList<GoodsEntity>>{
        return apiService.goods(category_id,currentPage,pageSize)
    }
}